package com.bjpowernode.crm.workbench.dto;

import lombok.*;

import java.util.List;

/**
 * 按条件分页查询市场活动时需要的参数
 *
 * @author 刘逸晖
 */
@NoArgsConstructor
@AllArgsConstructor
@ToString
@EqualsAndHashCode
public class ActivityQueryDto {

    /**
     * 名称
     */
    private String name;

    /**
     * 所有者
     */
    private String owner;

    /**
     * 开始日期
     */
    private String startDate;

    /**
     * 结束日期
     */
    private String endDate;

    /**
     * 当前页，从 1 开始
     */
    private int pageNo = 1;

    /**
     * 每页条数
     */
    private int pageSize = 5;

    /**
     * 在数据库中查询时从第几条开始获取
     */
    private int beginNo;

    /**
     * 所有者 id 列表
     */
    private List<String> idOfOwners;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getOwner() {
        return owner;
    }

    public void setOwner(String owner) {
        this.owner = owner;
    }

    public String getStartDate() {
        return startDate;
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public void setPageNoAndPageSizeAndBeginNo(int pageNo, int pageSize) {
        this.pageNo = pageNo;
        this.pageSize = pageSize;
        this.beginNo = (pageNo - 1) * pageSize;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
        this.beginNo = (pageNo - 1) * pageSize;
    }

    public int getPageNo() {
        return pageNo;
    }

    public void setPageNo(int pageNo) {
        this.pageNo = pageNo;
        this.beginNo = (pageNo - 1) * pageSize;
    }

    public int getBeginNo() {
        return beginNo;
    }

    public void setBeginNo(int beginNo) {
        this.beginNo = beginNo;
    }

    public List<String> getIdOfOwners() {
        return idOfOwners;
    }

    public void setIdOfOwners(List<String> idOfOwners) {
        this.idOfOwners = idOfOwners;
    }
    
}
